#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "NamedElement.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class OccurrenceSpecification;

/// <summary>
/// GeneralOrdering
/// A GeneralOrdering represents a binary relation between two
/// OccurrenceSpecifications, to describe that one OccurrenceSpecification must
/// occur before the other in a valid trace. This mechanism provides the ability to
/// define partial orders of OccurrenceSpecifications that may otherwise not have a
/// specified order.
/// </summary>
class UMLMODEL_EXPORT GeneralOrdering : public NamedElement {

public: // Constructors and destructors
    explicit GeneralOrdering(const QString& umlType="uml::GeneralOrdering");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// after getter
    /// The OccurrenceSpecification referenced comes after the OccurrenceSpecification
    /// referenced by before.
    /// </summary>
    shared_ptr<OccurrenceSpecification> after() const;

    /// <summary>
    /// after setter
    /// The OccurrenceSpecification referenced comes after the OccurrenceSpecification
    /// referenced by before.
    /// </summary>
    void setAfter(shared_ptr<OccurrenceSpecification> value);

    /// <summary>
    /// before getter
    /// The OccurrenceSpecification referenced comes before the OccurrenceSpecification
    /// referenced by after.
    /// </summary>
    shared_ptr<OccurrenceSpecification> before() const;

    /// <summary>
    /// before setter
    /// The OccurrenceSpecification referenced comes before the OccurrenceSpecification
    /// referenced by after.
    /// </summary>
    void setBefore(shared_ptr<OccurrenceSpecification> value);

private: // Fields
    /// <summary>
    /// after
    /// The OccurrenceSpecification referenced comes after the OccurrenceSpecification
    /// referenced by before.
    /// </summary>
    shared_ptr<OccurrenceSpecification> after_;

    /// <summary>
    /// before
    /// The OccurrenceSpecification referenced comes before the OccurrenceSpecification
    /// referenced by after.
    /// </summary>
    shared_ptr<OccurrenceSpecification> before_;

};

} // namespace uml
